package com.shahe.GirlsDay;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;

/**
 * Created by Sarah on 7/06/2014.
 */
public class RegisterActivity extends Activity {
    /**
     * Called when the activity is first created.
     */

    final static int WRAP_CONTENT = -2;
    int[] msgIds = {R.string.relationship00,R.string.relationship01,R.string.relationship02,R.string.relationship03,R.string.relationship04};

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.registerpage);

        Spinner spinner = (Spinner)this.findViewById(R.id.reg_spinner);
        BaseAdapter baseAdapter = new BaseAdapter() {
            @Override
            public int getCount() {
                return 5;
            }

            @Override
            public Object getItem(int position) {
                return null;
            }

            @Override
            public long getItemId(int position) {
                return 0;
            }

            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                LinearLayout linearLayout = new LinearLayout(RegisterActivity.this);
                linearLayout.setOrientation(LinearLayout.HORIZONTAL);
                //linearLayout.setBackgroundColor(getResources().getColor(R.color.black));

                TextView textView = new TextView(RegisterActivity.this);
                textView.setText("" + getResources().getText(msgIds[position]));
                textView.setTextSize(18);
                //textView.setBackgroundColor(getResources().getColor(R.color.title_color));
                textView.setTextColor(getResources().getColor(R.color.gray));
                linearLayout.addView(textView);

                return linearLayout;
            }
        };
        spinner.setAdapter(baseAdapter);

        final Button cancelButton = (Button)findViewById(R.id.btn_reg_cancel);
        final Button createButton = (Button)findViewById(R.id.btn_reg_create);

        cancelButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(RegisterActivity.this, MainActivity.class);

                //取消设置的内容。。。。。

                startActivity(intent);
            }
        });

        createButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(RegisterActivity.this, MainActivity.class);

                //save设置的内容。。。。。

                startActivity(intent);
            }
        });

    }
}
